package com.tender.utils;

import lombok.Data;

/**
 * @author cuisudong
 */
public class SecretContextUtil {

    private static final ThreadLocal<SecretContext> threadLocal = new ThreadLocal<>();

    public static void setSecretContext(SecretContext context) {
        threadLocal.set(context);
    }

    public static SecretContext getSecretContext() {
        return threadLocal.get();
    }

    public static void clear() {
        threadLocal.remove();
    }

    @Data
    public static class SecretContext {

        private String keyAES128;

        private String secretAES128;

        private String ivAES;

    }

}
